#!/bin/bash
#利用case语句写
#$1就是传入的参数
case $1 in
"start") {

	for i in zookeeper_node2 zookeeper_node3 zookeeper_node4
	do	echo "---------------zookeeper $i 启动 ---------------"
		ssh $i "/opt/zookeeper-3.8.0/bin/zkServer.sh start"
	done		
}
;;

"stop") {
	for i in zookeeper_node2 zookeeper_node3 zookeeper_node4
        do	
		echo "---------------zookeeper $i 状态 ---------------"
                ssh $i "/opt/zookeeper-3.8.0/bin/zkServer.sh stop"
        done
}
;;

"status") {
	for i in zookeeper_node2 zookeeper_node3 zookeeper_node4
        do
		echo "---------------zookeeper $i 状态 ---------------"
                ssh $i "/opt/zookeeper-3.8.0/bin/zkServer.sh status"
        done
}
;;
esac
